# Maintainer: Muflone http://www.muflone.com/contacts/english/
# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
# Contributor: Sebastien Binet <binet@lblbox>

pkgname=python-ptrace
pkgver=0.9.8
pkgrel=4
pkgdesc='Python binding of ptrace library to trace processes and syscalls'
url='https://github.com/haypo/python-ptrace'
arch=('any')
license=('GPL2')
depends=('python' 'python-six')
makedepends=('python-sphinx' 'python-setuptools')
source=(https://github.com/haypo/python-ptrace/archive/${pkgver}/${pkgname}-${pkgver}.tar.gz)
sha512sums=('f50ba7d457bf20a161a99913a552f2e829e97975d7cfbf8cf5d89b4f2320772b537678f2e70b9aaa88341c4f01d4bf41f62683e913628db503152f3510a013a3')
b2sums=('3d387beca9c92c0e3bbd5cf2c9d2af447c233b631e894ce1af2cdc697a1a48e24a299bbc998cd187ac9ad0f45bfc886f476afdb69329d761e8730a047731126b')

build() {
  cd ${pkgbase}-${pkgver}
  python setup.py build
  make -j1 -C doc man text SPHINXBUILD=sphinx-build
}

check() {
  cd ${pkgbase}-${pkgver}
  python runtests.py || echo "Warning: tests only run in an env with ptrace allowed"
}

package() {
  cd ${pkgbase}-${pkgver}
  python setup.py install --prefix=/usr --root="${pkgdir}" --optimize=1 --skip-build
  install -Dm 644 doc/build/text/*.txt -t "${pkgdir}/usr/share/doc/${pkgname}"
  cp -a examples "${pkgdir}/usr/share/doc/${pkgname}"
  install -Dm 644 doc/build/man/${pkgbase}.1 -t "${pkgdir}/usr/share/man/man1"
}

# vim: ts=2 sw=2 et:
